package zestaw4.klonowanie_obiektow;

/**
 * Author: Daniel
 * Date: 03.08.13
 */

public class Main {
    public static void show(String nam, int[] arr) {
        System.out.println(nam);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(" " + arr[i]);
        }
        System.out.println();
    }

    public static void main(String[] args) {
        /*A a = new A();
        A a1 = a;
        A a2 = (A) a.clone();

        System.out.println(a.getA() + " " + a1.getA() + " " + a2.getA());
        System.out.println("a==a1: " + (a == a1) + " a==a2: " + (a == a2));*/

        B x = new B();
        B x1 = (B) x.clone();

        show("x", x.getArr());
        show("x1 - nowy obiekt kopia x", x1.getArr());

        x.set(1, 10);
        show("x1 - płytka kopia, nie jest niezależnym obiektem!", x1.getArr());


    }
}
